<?php

class sbAdmin {

    static public function getAdminHotel($page) {
        $limStart = ($page * sbValues::HOTELS_IN_ADMIN_PAGE) - (sbValues::HOTELS_IN_ADMIN_PAGE);
        $hotels = Doctrine_Query::create()->
                select('h.*')->
                from('tblHotel h')->
                offset($limStart)->
                limit(sbValues::HOTELS_IN_ADMIN_PAGE)->
                execute();

        $rows = Doctrine_Query::create()->
                select('COUNT(*)')->
                from('tblHotel')->
                execute();
        
        return array('hotels' => $hotels, 'count' => $rows[0]['COUNT']);
    }
}
?>

